package com.lipaluma.examples.annotation.product;

import com.lipaluma.annotations.adaptors.Adapt;
import com.lipaluma.annotations.mapping.MapColumn;
import com.lipaluma.annotations.validations.ValidateDecimal;
import com.lipaluma.annotations.validations.ValidateInteger;
import com.lipaluma.csv.annotations.config.CSV;

@CSV(hasHeader=true, mapColumnsByHeaders=true)
public class Product2 {
	@MapColumn(index=1)
	@ValidateInteger(unique=true)
	private Long id;
	
	@MapColumn(index=2)
	private String libelle;

	@MapColumn(index=3)
	private String code;

	@MapColumn(index=4, pattern="####,##", locale="fr")
	@ValidateDecimal(max=10.0)
	private double price;
	
	@MapColumn(index=5)
	private int stock;

	@MapColumn(index=6)
	@Adapt(truncateAt=20)
	private String comments;

	public Long getId() {
		return id;
	}

	public String getLibelle() {
		return libelle;
	}

	public String getCode() {
		return code;
	}

	public double getPrice() {
		return price;
	}

	public int getStock() {
		return stock;
	}

	public String getComments() {
		return comments;
	}
}
